package mapeamentos.modelo.beans;

import java.util.Date;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Aluno_Exercicio {
	
	@EmbeddedId
	private AlunoExercicioPK chavecomposta;
	
	@Temporal(TemporalType.DATE)
	private Date data;
	
	private Integer nota;

	public AlunoExercicioPK getChavecomposta() {
		return chavecomposta;
	}

	public void setChavecomposta(AlunoExercicioPK chavecomposta) {
		this.chavecomposta = chavecomposta;
	}

	public Date getData() {
		return data;
	}

	public void setData(Date data) {
		this.data = data;
	}

	public Integer getNota() {
		return nota;
	}

	public void setNota(Integer nota) {
		this.nota = nota;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((chavecomposta == null) ? 0 : chavecomposta.hashCode());
		result = prime * result + ((data == null) ? 0 : data.hashCode());
		result = prime * result + ((nota == null) ? 0 : nota.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Aluno_Exercicio other = (Aluno_Exercicio) obj;
		if (chavecomposta == null) {
			if (other.chavecomposta != null)
				return false;
		} else if (!chavecomposta.equals(other.chavecomposta))
			return false;
		if (data == null) {
			if (other.data != null)
				return false;
		} else if (!data.equals(other.data))
			return false;
		if (nota == null) {
			if (other.nota != null)
				return false;
		} else if (!nota.equals(other.nota))
			return false;
		return true;
	}
}
